import { createBrowserRouter, Navigate } from 'react-router-dom';
import Login from '../views/login';
import NotFound from '../views/notfound/indfex';
import Welcome from '../views/welcome';
import LayoutCon from '../layout';
import Dashboard from '../views/dashboard';
import User from '../views/user';
import Dept from '../views/dept';
import Role from '../views/role';
import Menu from '../views/menu';

export const router = [
  {
    element: <LayoutCon />,
    children: [
      {
        path: '/welcome',
        element: <Welcome />,
      },
      {
        path: '/dashboard',
        element: <Dashboard />,
      },
      {
        path: '/userList',
        element: <User />,
      },
      {
        path: '/deptList',
        element: <Dept />,
      },
      {
        path: '/roleList',
        element: <Role />,
      },
      {
        path: '/menuList',
        element: <Menu />,
      },
    ],
  },
  { path: '/', element: <Navigate to='/welcome' /> },
  { path: '/login', element: <Login /> },
  { path: '*', element: <NotFound /> },
];

export default createBrowserRouter(router);
